<?php
/**
 * Created by PhpStorm.
 * User: mac
 * Date: 2019/7/8
 * Time: 11:32 AM
 */

namespace App\HttpController;


use EasySwoole\Http\AbstractInterface\Controller;
use EasySwoole\Mysqli\Config;
use EasySwoole\Mysqli\Mysqli;

class Category extends Controller
{
    function index()
    {
        $configArr = \EasySwoole\EasySwoole\Config::getInstance()->getConf('MYSQL');
        $config = NEW Config($configArr);
        $db = NEW Mysqli($config);
/*        // TODO: Implement index() method.
        $this->response()->write('hello word Category');*/
        $data = [
            0=>['id'=>1,'name'=>'黎明1'],
            1=>['id'=>2,'name'=>'黎明2'],
            2=>['id'=>3,'name'=>'黎明3'],
        ];

        return $this->writeJson(200,$data,'OK');
    }
}